import request from '@/plugins/request/js/index.js';

export default {
	me(data, canRunState = true) {
		const instance = new request();
		const r = instance.get({
			url: "/v1/users/me",
			data: data
		});
		!canRunState && instance.stop(r)
		return r;
	},
	updatePhone(id, data, canRunState = true) {
		const instance = new request();
		const r = instance.post({
			url: `/v1/users/${id}/update-phone`,
			data: data
		});
		!canRunState && instance.stop(r)
		return r;
	},
	update(id, data, canRunState = true) {
		const instance = new request();
		const r = instance.patch({
			url: `/v1/users/${id}`,
			data: data
		});
		!canRunState && instance.stop(r)
		return r;
	}
}